<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="renderer" content="webkit">
    <meta name="format-detection" content="telephone=no">
    <meta name="csrf-param" content="_homeCSRF">
    <meta name="csrf-token" content="ZkhraDhIbllXZVM8ZxAbLVMmKiIMJQwTASNdCUt/KioiejgiAQEGaQ==">
    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="../src/img/favicon.ico" rel="shortcut icon">
    <link href="/images/favicon.ico" rel="bookmark">
    <link href="../src/css/jquery.bxslider.css" rel="stylesheet">
    <link href="../src/iconfonts/iconfont.css" rel="stylesheet">
    <link href="../src/css/bootstrap.css" rel="stylesheet">
    <link href="../src/css/dookayui.css" rel="stylesheet">
    <link href="../src/css/dx.css" rel="stylesheet">
    <link href="../src/css/dy.css" rel="stylesheet">
    <!--[if lte IE9]>
    <script src="../src/js/html5shiv.js"></script>
    <![endif]-->
    <!--[if lte IE9]>
    <script src="../src/js/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<div class="header"></div>
<div id="pbody" class="">
    <div class="industry-sector">
    <div class="dx-content">
    </div>
        <div class="project-show">
            <div class="container">
                <div class="row">
                    <div class="col-md-12 col-xs-12 col-sm-12">
                        <!--<div class="title">PROJECT SHOW</div>-->
                        <div class="subhead">项目展示</div>
                        <div class="project-slide ">
                            <div class="container-fluid">
                                <div class="row">
                                    <div class="j_project_slider">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<footer class="footer"></footer>

<script src="../src/js/dookayui.min.js"></script>
<script src="../src/js/common.js"></script>

<script>

    function serilizeURL(url) {
        var rs = url.split("?")[1];
        var arr = rs.split("&");
        var json = {};
        for (var i = 0; i < arr.length; i++) {
            if (arr[i].indexOf("=") != -1) {
                json[arr[i].split("=")[0]] = arr[i].split("=")[1];
            }
            else {
                json[arr[i]] = "undefined";
            }
        }

        return json;
    }
    var url = location.href;
    var pid = serilizeURL(url).pid;  //一级菜单栏id
    var urls = '';
    var secondMenuId = serilizeURL(url).secondMenuId; //二级菜单栏id

    $(function () {
        commonApp.init();
        $(".header").load("http://192.168.100.181:8080/huoge-edu/public-file/business-header.html", function () {
            $(".px-mobile .dy-nav .bread").on("click", function () {
                $(".px-mobile .main-nav").slideToggle("slow");
            });
        });
    })

    $(document).ready(function () {

        $(".footer").load("http://192.168.100.181:8080/huoge-edu/public-file/footer.html");
    });

    function getFragment(param,secondMenuId) {
        var getFragmentLists;
        var getFragmentLength;
        $.ajax({
            url: "http://192.168.100.181:8080/api/fragment/"+secondMenuId+'/'+param,
            success: function (data) {
                getFragmentLists=data.data;
                getFragmentLength=getFragmentLists.length;
                $('.dx-content').append(getFragmentLists);
                console.log(getFragmentLists);
            }});
    }


    function queryArticleByColumnId(id) {
        $.ajax({
            url: "http://192.168.100.181:8080/api/article/queryArticleByColumn?id=" + id,
            success: function (data) {

                articleLists = data.data;
                var articleListsLength = articleLists.length;

                for (var i = 0; i < articleListsLength; i++) {
                    $('.j_project_slider').append(`
                                        <div class="slider">
                                            <div class="pic">
                                                <a href="http://192.168.100.181:8080/huoge-edu/common/business-article-details.html?articleId=${articleLists[i].id}&pid=${pid}&secondMenuId=${secondMenuId}" data-articleId=${articleLists[i].id}   class="headline"><img src=${articleLists[i].coverImageUrl}   alt="无标题5.jpg">                                          </a>
                                                <div class="number">1</div>
                                            </div>
                                            <div class="year">${articleLists[i].createDate.substr(0,7)}</div>
                                            <a href="http://192.168.100.181:8080/huoge-edu/common/business-article-details.html?articleId=${articleLists[i].id}&pid=${pid}&secondMenuId=${secondMenuId}" data-articleId=${articleLists[i].id}   class="headline">
                                                <p class="headline-title"></p>
                                                <p class="headline-name">${articleLists[i].title}</p>
                                            </a>
                                        </div>


`);
                    $('.mobile-project-list').append(
                        `<div class="text-pic">
                                                <a href="http://192.168.100.181:8080/huoge-edu/common/business-article-details.html?articleId=${articleLists[i].id}&pid=${pid}&secondMenuId=${secondMenuId}" data-articleId=${articleLists[i].id} class="clearfix pb-0 articleLists">
                                                    <div class="text">
                                                        <p class="font-14 mb-1">${articleLists[i].title}</p>
                                                        <p class="time font-14">${articleLists[i].createDate.substr(0,7)}</p>
                                                    </div>
                                                    <div class="pic pull-right">
                                                        <img src=${articleLists[i].coverImageUrl} alt="">
                                                    </div>
                                                </a>
                                            </div>`);


                }

            }
        })
    }


    $(document).ready(function () {
        if (undefined != secondMenuId) {
            getFragment('business-body', secondMenuId);
            queryArticleByColumnId(secondMenuId);
        }
        setTimeout(function () {
            var nw = screen.width;
            if (nw <= 768) {
                var bkSlider = $(".j_project_slider").bxSlider({
                    auto: true,
                    pager: false,
                    minSlides: 1,
                    maxSlides: 1,
                    moveSlides: 1,
                    slideWidth: 383.33,
                    onSlideAfter: function () {
                        bkSlider.startAuto();
                    }
                });
            } else {
                $(".j_project_slider").bxSlider({
                    auto: true,
                    pager: false,
                    minSlides: 1,
                    maxSlides: 3,
                    moveSlides: 1,
                    slideWidth: 383.33
                });
            }
            //判断滚动条
            var nav = $("#j_nav"); //得到导航对象
            var win = $(window); //得到窗口对象
            var sc = $(document);//得到document文档对象

            win.scroll(function () {
                if (sc.scrollTop() >= 112) {
                    nav.addClass("fixednav");
                } else {
                    nav.removeClass("fixednav");
                }
            });

            if ($(".slider").length == 0) {
                $(".bx-controls").css("display", "none")
            }
        },1000)
    })



</script>
</body>
</html>
